<%@ page language="java" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<HTML>
	<HEAD>
		<meta http-equiv="Content-Language" content="zh-cn">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<script src="${ pageContext.request.contextPath }/js/jquery-1.11.3.min.js" type="text/javascript"></script>
		<LINK href="${pageContext.request.contextPath}/css/Style1.css" type="text/css" rel="stylesheet">
	</HEAD>
	<script type="text/javascript">
		
		$(function(){
			$("#user_phone").blur(function(){
			//	alert(222);
				var phone  = $(this).val();
				var pattern = /^1[34578]\d{9}$/;
				//alert(pattern.test(phone));
				if(!pattern.test(phone)){
					alert("手机号码格式不正确！");
					$(".button_ok").attr("disabled",true);
					$(".button_ok").text("请修改正确的手机号码！");
					
				}
				if(pattern.test(phone)){
					$(".button_ok").text("确定");
					$(".button_ok").attr("disabled",false);
				}
				}
			);
		});
	</script>
	
	<body>
		<form id="userAction_save_do" name="Form1" action="${pageContext.request.contextPath}/AdminUserServlet?method=saveUser" method="post" >
			<input type="hidden" name="user_id" value="${ user.user_id }" />
			<%-- <input type="hidden" name="state" value="${ user.state }" />
			<input type="hidden" name="code" value="${ user.code }" /> --%>
			&nbsp;
			<table cellSpacing="1" cellPadding="5" width="100%" align="center" bgColor="#eeeeee" style="border: 1px solid #8ba7e3" border="0">
				<tr>
					<td class="ta_01" align="center" bgColor="#afd1f3" colSpan="4"
						height="26">
						<strong><STRONG>编辑用户</STRONG>
						</strong>
					</td>
				</tr>

				<tr>
					<td width="18%" align="center" bgColor="#f5fafe" class="ta_01">
						用户名称：
					</td>
					<td class="ta_01" bgColor="#ffffff">
						<input type="text" name="user_name" value="${ user.user_name }" id="userAction_save_do_logonName" class="bg"/>
					</td>
					<td width="18%" align="center" bgColor="#f5fafe" class="ta_01">
						密码：
					</td>
					<td class="ta_01" bgColor="#ffffff">
						<input type="text" name="user_password" value="${user.user_password }" id="userAction_save_do_logonName" class="bg"/>
					</td>
				</tr>
				<tr>
					<td width="18%" align="center" bgColor="#f5fafe" class="ta_01">
						用户账号：
					</td>
					<td class="ta_01" bgColor="#ffffff">
						<input type="text" name="user_account" value="${ user.user_account }" id="userAction_save_do_logonName" class="bg" disabled/>
						</td>
					<td width="18%" align="center" bgColor="#f5fafe" class="ta_01">
						性别：
					</td>
					<%-- <td class="ta_01" bgColor="#ffffff">
						<input type="text" name="user_sex" value="${ user.user_sex }" id="userAction_save_do_logonName" class="bg" />
					
					</td> --%>
					<td class="ta_01" bgColor="#ffffff" colspan="2">
						<select name="user_sex" >
						
							<option name="user_sex" value="1" <c:if test="${user.user_sex==1 }">selected</c:if>>男</option>
							<option name="user_sex" value="0" <c:if test="${user.user_sex==0 }">selected</c:if>>女</option>
						
						
						</select>
					</td>
				</tr>
				<tr>
					<td width="18%" align="center" bgColor="#f5fafe" class="ta_01">
						电话：
					</td>
					<td class="ta_01" bgColor="#ffffff">
						<input type="text" name="user_phone" value="${ user.user_phone }" id="user_phone" class="bg"/>
						</td>
					<td width="18%" align="center" bgColor="#f5fafe" class="ta_01">
						锁定与否：<%-- ${ user.lock ==1} --%>
					</td>
					<td class="ta_01" bgColor="#ffffff">
					<select name="isforbidden" >
						<option  name="isforbidden" value="0" <c:if test="${user.isforbidden==0 }">selected</c:if>> 未锁定</option>
						<option  name="isforbidden" value="1" <c:if test="${user.isforbidden==1 }">selected</c:if>> 已锁定 </option>
					</select>
					</td>
				</tr>
				
				<tr>
					<td width="18%" align="center" bgColor="#f5fafe" class="ta_01">
						是否是管理员：
					</td>
					<td class="ta_01" bgColor="#ffffff">
					<select name="isadmin" >
						<option  name="isadmin" value="0" <c:if test="${user.isadmin==0 }">selected</c:if>> 普通用户</option>
						<option  name="isadmin" value="1" <c:if test="${user.isadmin==1 }">selected</c:if>> 管理员 </option>
					</select>
						</td>
				</tr>
			
				<tr>
					<td class="ta_01" style="WIDTH: 100%" align="center"
						bgColor="#f5fafe" colSpan="4">
						<button type="submit" id="userAction_save_do_submit" value="确定" class="button_ok">
							&#30830;&#23450;
						</button>

						<FONT face="宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT>
						<button type="reset" value="重置" class="button_cancel">&#37325;&#32622;</button>
						<FONT face="宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT>
						<INPUT class="button_ok" type="button" onclick="history.go(-1)" value="返回"/>
						<span id="Label1"></span>
					</td>
				</tr>
			</table>
		</form>
	</body>
</HTML>